import React from "react";
import { Spin, SpinProps } from 'antd';
import { useStyle } from "./style";

interface BoxSpinProps {
  style?: React.CSSProperties;
  spinProps?: SpinProps
}

const ProBoxSpin: React.FC<BoxSpinProps> = ({ style, spinProps }) => {
  const { styles } = useStyle();

  style = Object.assign({
    position: 'relative',
    width: '100%',
    minHeight: 200,
    textAlign: 'center',
  }, style);

  return (
    <div style={style} className={styles.center}>
      <Spin {...spinProps} />
    </div>
  );
};


export default ProBoxSpin;
